|
light6 2.2.0
|
API for configuring and manipulating Light 6 Click driver. More...
Topics | |
| Light 6 Registers List | |
| List of registers of Light 6 Click driver. | |
| Light 6 Registers Settings | |
| Settings for registers of Light 6 Click driver. | |
| Light 6 MikroBUS Map | |
| MikroBUS pin mapping of Light 6 Click driver. | |
Functions | |
| void | light6_cfg_setup (light6_cfg_t *cfg) |
| Light 6 configuration object setup function. | |
| err_t | light6_init (light6_t *ctx, light6_cfg_t *cfg) |
| Light 6 initialization function. | |
| err_t | light6_default_cfg (light6_t *ctx) |
| Light 6 default configuration function. | |
| err_t | light6_generic_write (light6_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
| Light 6 I2C writing function. | |
| err_t | light6_generic_read (light6_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
| Light 6 I2C reading function. | |
| uint8_t | light6_get_int_pin (light6_t *ctx) |
| Light 6 get INT pin function. | |
| err_t | light6_check_communication (light6_t *ctx) |
| Light 6 Check Communication function. | |
| err_t | light6_set_als_config (light6_t *ctx, uint16_t config) |
| Light 6 Set ALS Configuration function. | |
| err_t | light6_get_als_config (light6_t *ctx, uint16_t *config) |
| Light 6 Get ALS Configuration function. | |
| err_t | light6_set_als_threshold (light6_t *ctx, uint16_t threshold_low, uint16_t threshold_high) |
| Light 6 Set ALS Threshold function. | |
| err_t | light6_get_als_threshold (light6_t *ctx, uint16_t *threshold_low, uint16_t *threshold_high) |
| Light 6 Get ALS Threshold function. | |
| err_t | light6_get_int_flag (light6_t *ctx, uint8_t *int_flag) |
| Light 6 Get Interrupt Flag function. | |
| err_t | light6_get_raw_data (light6_t *ctx, uint16_t *als_data, uint16_t *ir_data) |
| Light 6 Get Raw Data function. | |
| err_t | light6_get_data (light6_t *ctx, float *als_data, uint16_t *ir_data) |
| Light 6 Get Processed Data function. | |
API for configuring and manipulating Light 6 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void light6_cfg_setup | ( | light6_cfg_t * | cfg | ) |
Light 6 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See light6_cfg_t object definition for detailed explanation. |
| err_t light6_check_communication | ( | light6_t * | ctx | ) |
Light 6 Check Communication function.
This function checks the device ID to verify communication with the Light 6 sensor.
| [in] | ctx | : Click context object. See light6_t object definition for detailed explanation. |
0 - Success, -1 - Error. | err_t light6_default_cfg | ( | light6_t * | ctx | ) |
Light 6 default configuration function.
This function executes a default configuration of Light 6 Click board.
| [in] | ctx | : Click context object. See light6_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t light6_generic_read | ( | light6_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out, | ||
| uint8_t | len ) |
Light 6 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
| [in] | ctx | : Click context object. See light6_t object definition for detailed explanation. |
| [in] | reg | : Start register address. |
| [out] | data_out | : Output read data. |
| [in] | len | : Number of bytes to be read. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t light6_generic_write | ( | light6_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_in, | ||
| uint8_t | len ) |
Light 6 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
| [in] | ctx | : Click context object. See light6_t object definition for detailed explanation. |
| [in] | reg | : Start register address. |
| [in] | data_in | : Data to be written. |
| [in] | len | : Number of bytes to be written. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t light6_get_als_config | ( | light6_t * | ctx, |
| uint16_t * | config ) |
Light 6 Get ALS Configuration function.
This function reads the ALS configuration register.
| [in] | ctx | : Click context object. See light6_t object definition for detailed explanation. |
| [out] | config | : Pointer to store the 16-bit configuration data. |
0 - Success, -1 - Error. | err_t light6_get_als_threshold | ( | light6_t * | ctx, |
| uint16_t * | threshold_low, | ||
| uint16_t * | threshold_high ) |
Light 6 Get ALS Threshold function.
This function reads the ALS threshold values.
| [in] | ctx | : Click context object. See light6_t object definition for detailed explanation. |
| [out] | threshold_low | : Pointer to store the lower threshold value. |
| [out] | threshold_high | : Pointer to store the upper threshold value. |
0 - Success, -1 - Error. | err_t light6_get_data | ( | light6_t * | ctx, |
| float * | als_data, | ||
| uint16_t * | ir_data ) |
Light 6 Get Processed Data function.
This function reads the raw IR data and ambient light intensity in lux based on raw ALS data.
| [in] | ctx | : Click context object. See light6_t object definition for detailed explanation. |
| [out] | als_data | : Pointer to store calculated ambient light intensity (in lux). |
| [out] | ir_data | : Pointer to store raw infrared sensor data. |
0 - Success, -1 - Error. | err_t light6_get_int_flag | ( | light6_t * | ctx, |
| uint8_t * | int_flag ) |
Light 6 Get Interrupt Flag function.
This function reads the interrupt flag status.
| [in] | ctx | : Click context object. See light6_t object definition for detailed explanation. |
| [out] | int_flag | : Pointer to store the interrupt flag status. |
0 - Success, -1 - Error. | uint8_t light6_get_int_pin | ( | light6_t * | ctx | ) |
Light 6 get INT pin function.
This function returns the INT pin logic state.
| [in] | ctx | : Click context object. See light6_t object definition for detailed explanation. |
| err_t light6_get_raw_data | ( | light6_t * | ctx, |
| uint16_t * | als_data, | ||
| uint16_t * | ir_data ) |
Light 6 Get Raw Data function.
This function reads the raw ALS and IR sensor data.
| [in] | ctx | : Click context object. See light6_t object definition for detailed explanation. |
| [out] | als_data | : Pointer to store raw ambient light sensor data. |
| [out] | ir_data | : Pointer to store raw infrared sensor data. |
0 - Success, -1 - Error. | err_t light6_init | ( | light6_t * | ctx, |
| light6_cfg_t * | cfg ) |
Light 6 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See light6_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See light6_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t light6_set_als_config | ( | light6_t * | ctx, |
| uint16_t | config ) |
Light 6 Set ALS Configuration function.
This function sets the ALS (ambient light sensor) configuration register.
| [in] | ctx | : Click context object. See light6_t object definition for detailed explanation. |
| [in] | config | : 16-bit configuration data. |
0 - Success, -1 - Error. | err_t light6_set_als_threshold | ( | light6_t * | ctx, |
| uint16_t | threshold_low, | ||
| uint16_t | threshold_high ) |
Light 6 Set ALS Threshold function.
This function sets the ALS threshold values for interrupt generation.
| [in] | ctx | : Click context object. See light6_t object definition for detailed explanation. |
| [in] | threshold_low | : Lower threshold value. |
| [in] | threshold_high | : Upper threshold value. |
0 - Success, -1 - Error.